<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "bus_goods_dec".
 *
 * @property integer $dec_id
 * @property integer $dec_type
 * @property integer $dec_count
 * @property string $goods_name
 * @property string $supplier_name
 * @property string $dec_remark
 * @property string $dec_time
 * @property string $shop_id
 * @property string $boss_id
 * @property string $unique_flag
 * @property string $goods_specs
 * @property integer $repertory_count
 * @property string $goods_sell_price
 * @property integer $repertory_id
 */
class BusGoodsDec extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'bus_goods_dec';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['dec_type', 'dec_count', 'repertory_id', 'shop_id', 'boss_id', 'repertory_count'], 'integer'],
            [['dec_count', 'goods_name', 'shop_id', 'boss_id', 'unique_flag'], 'required'],
            [['dec_time'], 'safe'],
            [['goods_sell_price'], 'number'],
            [['goods_name', 'supplier_name', 'dec_remark', 'unique_flag'], 'string', 'max' => 255],
            [['goods_specs'], 'string', 'max' => 45]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'dec_id' => 'Dec ID',
            'dec_type' => '出库类型   1：其他。2：报废。3：赠送。4：调拨。5：售卖。6：使用',
            'dec_count' => '出库数量',
            'goods_name' => '产品名称',
            'supplier_name' => '供应商',
            'dec_remark' => '备注',
            'dec_time' => '出库时间',
            'shop_id' => '所属分店',
            'boss_id' => '老板ID',
            'unique_flag' => '唯一标识',
            'goods_specs' => '规格',
            'repertory_count' => '库存',
            'goods_sell_price' => '零售价',
            'repertory_id' => '库存(商品)id'
        ];
    }
}
